$(function () {
    $.ajaxPrefilter(function (option) {
        option.url = 'http://www.liulongbin.top:3007' + option.url;
        option.headers = {
            'Authorization': localStorage.getItem('token')
        };
        option.complete = function (xhr) {
            if (xhr.responseJSON.status == 0 && xhr.responseJSON.message == '身份认证失败！') {
                // 删除假的token
                localStorage.removeItem('token');
                // 跳转到登录页面
                window.parent.location.href = '/login.html';
            }
        }
    })
})